//
//  FKIncomeDetail.m
//  WanTao
//
//  Created by Macbook Pro on 2019/3/29.
//  Copyright © 2019 Macbook Pro. All rights reserved.
//

#import "FKIncomeDetail.h"

@implementation FKIncomeDetail

+ (NSDictionary *)mj_objectClassInArray
{
    return @{@"order_goods" : [FKOrderGoods class]};
}

- (void)mj_keyValuesDidFinishConvertingToObject
{
    NSString *price = fkFORMAT(@"消费金额: ￥%@", _price);
    _priceStr = [price fk_addAttributeStyle:@"消费金额:" color:fkMainColor font:fk_adjustFont(12)];
    _commissionStr = fkFORMAT(@"预估佣金: ￥%@", _commission);
    _timeStr = fkFORMAT(@"创建日: %@", [_add_time fk_timeWithFormat:@"MM-dd HH:mm"]);
    if (_update_time) {
        _timeStr = fkFORMAT(@"%@ 结算日: %@", _timeStr, [_update_time fk_timeWithFormat:@"MM-dd HH:mm"]);
    }
    _orderStr = fkFORMAT(@"订单号: %@", _order_sn);
    if ([_order_type isEqualToString:@"1"]) {
        _orderType = @"个人";
    } else if ([_order_type isEqualToString:@"2"]) {
        _orderType = @"团队";
    }
    
    //    20,30已付款 40 已结算 50 已失效
    if ([_status isEqualToString:@"20"] || [_status isEqualToString:@"30"]) {
        _statusName = @"待结算";
        _statusBgColor = [UIColor fk_colorWithHex:0xA5BBF4];
    } else if ([_status isEqualToString:@"40"]) {
        _statusName = @"已结算";
        _statusBgColor = [UIColor fk_colorWithHex:0x63E4AE];
    } else if ([_status isEqualToString:@"50"]) {
        _statusName = @"已失效";
        _statusBgColor = fkColor999999;
    }
}

@end
